<div class="container-fluid">
    <div id="failedBox" class="hide"></div>
    <div class="panel panel-default">
        <div class="panel-body">
            <br>{{$auth := .auth}}
            <form class="form-horizontal" method="post" action="{{if $auth}} /system/auth/modify {{else}} /system/auth/save {{end}}">
                <input type="hidden" name="login_auth_id" value="{{$auth.login_auth_id}}">
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="text-danger"> * </span> 认证名称</label>
                    <div class="col-sm-5">
                        <input type="text" name="name" class="form-control" placeholder="请输入登录认证名称" value="{{$auth.name}}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="text-danger"> * </span> 用户名前缀</label>
                    <div class="col-sm-5">
                        <input type="text" name="username_prefix" class="form-control" placeholder="请输入用户名前缀（如：ldap）" value="{{$auth.username_prefix}}">
                    </div>
                    <div class="col-sm-3 form-comment">
                        <span class="text-danger"> * 只能由数字和字母组成</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="text-danger"> * </span> 认证URL</label>
                    <div class="col-sm-5">
                        <input type="text" name="url" class="form-control" placeholder="请输入登录认证接口" value="{{$auth.url}}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label"><span class="text-danger"></span> 附加参数</label>
                    <div class="col-sm-5">
                        <textarea name="ext_data" class="form-control" rows="4" placeholder="请输入登录认证接口需要的扩展数据或者配置数据">{{$auth.ext_data}}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="button" onclick="Form.ajaxSubmit(this.form, true);" class="btn btn-primary">保存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>